/*
 * Copyright 2011 Michael Guo
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package edu.uc.cs.guome.ir;

import java.io.Serializable;

/**
 * The node object in the PostingsList
 * @author(name="Michael Guo",date="01/18/2011")
 * @version 0.1
 */
public class PostingsListNode implements Serializable{
	
	private static final long serialVersionUID = -6983563956432771811L;
	private int docID;
	private TermFrequency tf;
	
	public PostingsListNode() {
		this.setDocID(-1);
		this.setTf(new TermFrequency());
	}
	
	public PostingsListNode(int id, TermFrequency t) {
		this.docID = id;
		this.setTf(t);
	}

	public void setDocID(int docID) {
		this.docID = docID;
	}

	public int getDocID() {
		return docID;
	}

	public void setTf(TermFrequency tf) {
		this.tf = tf;
	}

	public TermFrequency getTf() {
		return tf;
	}
	
	public String toString() {
		return ("[" + docID + ":" + tf.getTf() + "]");
	}
}
